var EXPORTED_SYMBOLS = ["mldonkeyClientsContainer"];

Components.utils.import("resource://mldonkeyff/MLDonkeyUtils.js");
Components.utils.import("resource://mldonkeyff/MLDonkeyClient.js");

var mldonkeyClientsContainer = {
	clients: new Array(/* of MLDonkeyClient */),
	
	getClient: function(hostname, port, username) {
		var identifier = MLDonkeyClient.createIdentifier(hostname, port, username);
		//
		var client = this.clients[identifier];
		if(client == null) {
			this.clients[identifier] = new MLDonkeyClient(hostname, port, username, password);
		}
		return this.clients[identifier];
	},
	
	getClientById: function(identifier) {
		var client = this.clients[identifier];
		if(client == null) {
			this.clients[identifier] = new MLDonkeyClient(hostname, port, username, password);
		}
		return this.clients[identifier];
	},
	
};
